﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.TPYRS
{
    class Class3
    {
        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.IsLastPeriod)
            {
                da.Value = ppa.TotalFee;
                ppa.IsCurrentFinish = true;
            }

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故") || ppa.SchemePeriodActing.InsurantStates.Contains("全残"))
            {
                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;
            }

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故") || ppa.SchemePeriodActing.InsurantStates.Contains("全残"))
            {
                da.Value = ppa.TotalFee;
                da.Description = "如果现金价值较大，则返回现金价值";
                ppa.IsCurrentFinish = true;
            }

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("特定疾病") )
            {
                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;
            }

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("特定身故") )
            {
                da.Value = ppa.Amount;
                ppa.SchemePeriodActing.InsurantStates.Add("身故");
                ppa.IsCurrentFinish = true;
            }
            else if (ppa.SchemePeriodActing.InsurantStates.Contains("特定全残"))
            {
                da.Value = ppa.Amount;
                ppa.SchemePeriodActing.InsurantStates.Add("全残");
                ppa.IsCurrentFinish = true;
            }

        }

    }
}
